package com.wish.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wish.dto.InterfaceInfoDto;
import com.wish.entity.SysInterfaceInfo;
import com.wish.mapper.SysInterfaceInfoMapper;
import com.wish.service.ISysInterfaceInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 五组
 * @since 2021-03-22
 */
@Service
public class SysInterfaceInfoServiceImpl extends ServiceImpl<SysInterfaceInfoMapper, SysInterfaceInfo> implements ISysInterfaceInfoService {
    @Autowired
    SysInterfaceInfoMapper interfaceInfoMapper;

    @Override
    public PageInfo<SysInterfaceInfo> getlist(InterfaceInfoDto interfaceInfoDto) {
        PageHelper.startPage(interfaceInfoDto.getPageNum(),interfaceInfoDto.getPageSize());
        List<SysInterfaceInfo> list = interfaceInfoMapper.getlist(interfaceInfoDto);
        return new PageInfo<>(list);
    }

    @Override
    public SysInterfaceInfo getOne(String interfaceNo) {
        return interfaceInfoMapper.getOne(interfaceNo);
    }

    @Override
    public boolean update(SysInterfaceInfo sysInterfaceInfo) {
        return interfaceInfoMapper.update(sysInterfaceInfo);
    }
}
